package com.fw.model;

import java.util.List;

import com.jfinal.plugin.activerecord.Model;

public class Role extends Model<Role>{

	private static final long serialVersionUID = 1L;
	public static final Role roleDao = new Role();
	
	public List<Permission> getPermissionsByRole(){
		String sql = "select p.* from role r,permission p,role_permission rp where r.r_id = rp.r_id and p.p_id = rp.p_id and r.r_id = ?";
		return Permission.permissonDao.find(sql, get("r_id"));
	}
}
